Skip to content

Show readable species names to players - #49

Merged
XxFran10xX merged 1 commit into
mainfrom
species-display-names
Nov 21, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
species-display-names

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Status record

  • Reviewed: Fable 5.2 APPROVE at 7b1cf40 (2 minor notes on Title Case species names mid-sentence, kept as intended)
  • Second opinion: CodeRabbit APPROVED at 7b1cf40 (no comments)
  • Dev-tested: passed at 7b1cf40 (Black Cat / Maine Coon in hatch and sex prompts, care sheet and Pet House lore; display-name override works; no plugin errors)
  • Local tests: passed at 7b1cf40 (full mvn -o verify with the Windows-only directory fsync stubbed locally: 1062 tests, the only failure is the test of that stubbed path; every changed class has 100% line coverage; see Notes)

What changed

Players saw species names built from internal pet type IDs: "Catblack", "Mainecoon", "Bernesse" in the hatch prompt ("Will your new mainecoon be a boy or a girl?"), on the care sheet's Species item and in the Pet House list ("Female catblack").

  • New optional pets.<id>.display-name sets the species name players see. It is read only from the pet's own entry and is never inherited from species.<id>, so one breed's name can't spread to every dog or cat.
  • Without it (every existing config), the plugin uses a built-in name for the TFMC IDs that run words together: golden → Golden Retriever, catblack → Black Cat, catfunny → Funny Cat, catorange → Orange Cat, catgray → Gray Cat, cattabby → Tabby Cat, mainecoon → Maine Coon, bernesse → Bernese Mountain Dog, bordercollie → Border Collie, bordercolliegray → Gray Border Collie, lagottoromagnolo → Lagotto Romagnolo, yorkshire → Yorkshire Terrier, sphynx → Sphynx Cat. The names match the MMOItems egg names on Main, except golden, whose egg is just "Golden Companion Egg".
  • Any other ID becomes Title Case (cavalier_king_charles_spaniel → Cavalier King Charles Spaniel, snow_fox → Snow Fox).
  • The hatch prompt and Pet House lore no longer lowercase the name, so proper names stay capitalised ("Your new Maine Coon is a girl!", "Female Maine Coon").
  • Staff commands and staff menus still show the raw type ID, because staff type it in commands.

Pet type IDs, saved pets and items are not changed. The live config needs no edit. The commented fox_example in the default config documents the new key.

Why

Fix 1 of the 2026-11-21 player-text review. The live Main config has 22 pet types, and 13 of them had broken names.

How to test on Dev

  1. Install the PR build artifact on Dev and restart. The Dev config needs no change.
  2. /companionpets egg catblack and /companionpets egg mainecoon, then hatch one: the chat prompt names "Black Cat" or "Maine Coon", capitalised.
  3. Open that pet's care sheet: the Species item reads "Black Cat". Open a Pet House: the pet's lore line reads "Female Black Cat" or "Male Black Cat".
  4. Optional: add display-name: Shadow Cat under pets.catblack, run /companionpets reload, and check that the care sheet shows "Shadow Cat".

Notes

  • Locally on Windows, PetStore.close() fails on directory fsync (AccessDenied), also on unmodified origin/main (checked with PetTextsTest#aConfiguredTypeMadeOnlyOfSeparatorsCanHatchAndOpenItsPetProfile). With those fsyncs stubbed out locally, the whole suite passed (the one failure was the test of the stubbed path itself). The stub is not committed. Linux CI is authoritative.
  • Separate from this PR: the Meat Meal and Fish Meal lore says "restore 35 hunger" while CompanionPets gives 45. That text is in the MMOItems item file (plugins/MMOItems/item/pets.yml, MEAT_TREAT and FISH_TREAT base.lore), not in this plugin.

🤖 Generated with Claude Code

The hatch prompt, care sheet and Pet House list built species names from
pet type IDs, so players saw "Catblack", "Mainecoon" or "Bernesse".

Pet types now take an optional display-name (own entry only, never
inherited from species). Without it, the TFMC IDs that run words together
get built-in names (Black Cat, Maine Coon, Bernese Mountain Dog, ...) and
other IDs become Title Case. The names are no longer lowercased, so proper
names keep their capitals. IDs and saved data are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Pet species names can now be customised in configuration. When no name is set, pets use a readable name derived from their type.
    • Pet names are displayed consistently in hatching prompts and pet menus.

Pet configuration supports a display name for each pet type. When no display name is set, the type ID supplies a readable species name. Pet menus and hatch prompts use the resolved name.

Changes: Species name configuration and resolution

Layer / File(s) Summary
Configure and resolve species names
src/main/java/net/tfminecraft/companionpets/config/CompanionConfig.java, src/main/java/net/tfminecraft/companionpets/config/PetTypeDef.java, src/main/java/net/tfminecraft/companionpets/text/PetTexts.java, src/main/resources/config.yml, src/test/java/net/tfminecraft/companionpets/config/*, src/test/java/net/tfminecraft/companionpets/text/PetTextsTest.java
PetTypeDef stores the display name from the pet’s own configuration section. PetTexts uses a non-blank configured name or derives a readable name from the type ID. The example configuration and tests cover these rules.
Use resolved names in pet displays
src/main/java/net/tfminecraft/companionpets/gui/PetMenus.java, src/main/java/net/tfminecraft/companionpets/runtime/PetHatching.java, src/test/java/net/tfminecraft/companionpets/text/PetTextsTest.java
Pet profile and kennel entries, and hatch prompts, use names resolved through PetTypeDef. Integration tests check the displayed names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant CompanionConfig
  participant PetTypeDef
  participant PetTexts
  participant PetMenus
  participant PetHatching
  CompanionConfig->>PetTypeDef: constructs type with displayName
  PetMenus->>PetTypeDef: speciesName(type, typeId)
  PetTypeDef->>PetTexts: speciesName(displayName, id)
  PetTexts-->>PetTypeDef: configured or derived species name
  PetTypeDef-->>PetMenus: resolved species name
  PetHatching->>PetTypeDef: speciesName()
  PetTypeDef->>PetTexts: speciesName(displayName, id)
  PetTexts-->>PetTypeDef: configured or derived species name
  PetTypeDef-->>PetHatching: resolved species name
Loading

Suggested reviewers: nowkoo

Merge Risk: Minimal · up to 7b1cf

This change shows readable species names in the hatch prompt, care sheet and Pet House list. It does not touch saved pets or type IDs. No actionable merge risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96e94d09-7ed9-4986-a579-16223744cfba
Commits

Reviewing files that changed from the base of the PR and between cfd70f8 and 7b1cf40.

Files selected for processing: 9

  • src/main/java/net/tfminecraft/companionpets/config/CompanionConfig.java
  • src/main/java/net/tfminecraft/companionpets/config/PetTypeDef.java
  • src/main/java/net/tfminecraft/companionpets/gui/PetMenus.java
  • src/main/java/net/tfminecraft/companionpets/runtime/PetHatching.java
  • src/main/java/net/tfminecraft/companionpets/text/PetTexts.java
  • src/main/resources/config.yml
  • src/test/java/net/tfminecraft/companionpets/config/CompanionConfigCoverageTest.java
  • src/test/java/net/tfminecraft/companionpets/config/ConfigExamplesTest.java
  • src/test/java/net/tfminecraft/companionpets/text/PetTextsTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Nov 21, 2026
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 57aa0f7 into main Nov 21, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the species-display-names branch November 21, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant